<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>盒模型</title>
    <style>
        /* css reset */
        * {
            margin: 0;
            padding: 0;
        }

        body {
            display: flex;
            flex-direction: column;
            height: 100vh;
        }

        .box {
            /* box-sizing可以去设定盒子的计算方案
               默认值是content-box  w h 指定的是内容的大小 标准盒模型
               border-box  w h 包含了border以内的大小 怪异(IE)盒模型
            */
            box-sizing: border-box;
            width: 200px;
            height: 200px;
            background-color: red;
            margin: 10px;
            padding: 5px;
            border: 2px solid yellow;
        }

        .flex {
            display: flex;
        }

        main {
            flex: 1;
            position: relative;
        }

        .inner {
            position: absolute;
            top: 0;
            left: 0;
            width: 100px;
            height: 100px;
            background-color: pink;
            border-radius: 50%;
            /* 脱离了文档流 */
        }
        .container {
           flex: 1;
           overflow: scroll; 
        }
        header,footer {
            height: 44px;
            background-color: grey;
            text-align: center;
        }
        footer {
            display: flex;
            /* 开启了新的格式化上下文 */
            align-items: center;
            justify-content: center;
        }
        .more {
            position: absolute;
            width: 50px;
            height: 50px;
            background-color: yellow;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
            /* margin-left: -25px;
            margin-top: -25px; */
        }
    </style>
</head>

<body>
    <header>
        <h1>盒模型</h1>
    </header>
    <div class="container">
        <div class="row flex">
            <aside class="box"></aside>
            <main class="box">
                <div class="inner" style="z-index:999;"></div>
                <div style="position:absolute;width:100px;height:100px;background: black;">1+2+3</div>
                <div style="width:100px;height:100px;background: black;">1+2+3</div>
            </main>
            <aside class="box"></aside>
        </div>
    </div>
    <footer>
        <p>盒模型</p>
    </footer>
    <div class="more"></div>
</body>

</html>